UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D9e4u3+8A8SfNtlWZUkjr/R6iaJKaCgsD3PTbkXX5RA='
WHERE
key_id = '2203b2074fbb77e440933ec2657a403e791466586cbf5838472eb4aba329688e'
AND (
token = 'D9e4u3+8A8SfNtlWZUkjr/R6iaJKaCgsD3PTbkXX5RA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)