UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'goGnGrVhJ7y95YdnD8FDTZVxiWdWr2ajDdmow9t9ZNs='
WHERE
key_id = '2bde14fe0bd5d6491e8592ca191d5e8ad6a401d8e8aebd9de5b340a752a07333'
AND (
token = 'goGnGrVhJ7y95YdnD8FDTZVxiWdWr2ajDdmow9t9ZNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)