UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f0GjIe/jfl3HWr5CcUOZBK4OeQDJ8rv1QqdT3qorQqc='
WHERE
key_id = '4a639a989d4a26eafef0c78af0f51c560daf3e11d8ed853993ecce1be096fdaa'
AND (
token = 'f0GjIe/jfl3HWr5CcUOZBK4OeQDJ8rv1QqdT3qorQqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)