UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vuCd9sjkOQ93AfwQt9vDUKQjzL9I/wrpzvuE4XhLBII='
WHERE
key_id = '40cfc4d8edc41b50c0118f796c81cf81bfd3990063c3c1b613ad74f77acbcc40'
AND (
token = 'vuCd9sjkOQ93AfwQt9vDUKQjzL9I/wrpzvuE4XhLBII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)