UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BNbLsi/bQEe2qEll/iOS6tjDhEROtOwa0gdqPT+6HSU='
WHERE
key_id = 'fb1e85059f738b784e4a870101b81d64825d46bc0a7f418f7fdc0e4a06b9bbd1'
AND (
token = 'BNbLsi/bQEe2qEll/iOS6tjDhEROtOwa0gdqPT+6HSU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)