UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MTgcvQ4xmDX4lL7ogn3akPPEKy6Ls+2crx0i9dF+UTQ='
WHERE
key_id = '1faabd57fa98e5380b538bc41d2c3a0c99e301c337299be070eea5d745356f37'
AND (
token = 'MTgcvQ4xmDX4lL7ogn3akPPEKy6Ls+2crx0i9dF+UTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)