UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJM58buYy7U1lFj/zwlY3sVIfN8Ib7mXWQanlmK4OvE='
WHERE
key_id = '9bc608db76da8f8a07d70dd454408f7f3db65fc0c756aa631c1b44e6ef036cc5'
AND (
token = 'ZJM58buYy7U1lFj/zwlY3sVIfN8Ib7mXWQanlmK4OvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)