UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FubmCmzjJJ3krcot34KhCKQn9I0jkZOxyijA6FRvd+I='
WHERE
key_id = '5595b5b5ed373c33c3569b07d8afc57edd1e1b57536cf021b2a547227c611646'
AND (
token = 'FubmCmzjJJ3krcot34KhCKQn9I0jkZOxyijA6FRvd+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)