UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GkM8Yi8i+Rz67F2P5li7xSzDOyTkKmjvuiOPEzFhuMA='
WHERE
key_id = 'c29079ccc7c95ba099fe26ed0537261efbc83dc0267c15bf2cffc096b80a4fa6'
AND (
token = 'GkM8Yi8i+Rz67F2P5li7xSzDOyTkKmjvuiOPEzFhuMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)