UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vmTMzeZK+klBMwX8qehALZmkxeeK5YejroVLhj1D1AE='
WHERE
key_id = 'e520927833a55cb672dcfe0fabef914dca98246728522cfed6e31f078065c1c0'
AND (
token = 'vmTMzeZK+klBMwX8qehALZmkxeeK5YejroVLhj1D1AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)