UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E9oLfqVMvYNdWRWRQFRGG5hC6LsZO7b6/gFu0Cz1hdE='
WHERE
key_id = 'f689c34ecb1d0d7b21156d32d8f56a6890a45bfa93f25fccb3b1a24aaa85fb57'
AND (
token = 'E9oLfqVMvYNdWRWRQFRGG5hC6LsZO7b6/gFu0Cz1hdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)