UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CXNKrjYSfcFbFg3RFvlhOBeJVsmgutIph6NzZZde6EE='
WHERE
key_id = 'c6e6bede97473643e5831a76e0165475b3f9ef8aca0cad29c10f3373bbffe4e9'
AND (
token = 'CXNKrjYSfcFbFg3RFvlhOBeJVsmgutIph6NzZZde6EE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)