UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rttVbH3Jy921NUH5G4nrEF+hnnNwnHrCjpz+2oQUkm0='
WHERE
key_id = 'c84d528dd11de92501ee3fc3ad4633d988e55d2f48998b0e3fe91ef4f109e85b'
AND (
token = 'rttVbH3Jy921NUH5G4nrEF+hnnNwnHrCjpz+2oQUkm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)