UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V3nlPyu3MET2ETH0CWm9oEMVdOFOwbTgMOBO3jwk2Fw='
WHERE
key_id = 'd4ebeef83b6a5f121077e5f21c21c3002f3c846fdf3a71b8dc60867ad7168242'
AND (
token = 'V3nlPyu3MET2ETH0CWm9oEMVdOFOwbTgMOBO3jwk2Fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)