UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nfRFpSqfTSOFEGUKJ4pafFx3UFblRBwazK/cSJwfZXg='
WHERE
key_id = 'a23f1d0faafe8f0b28c7d1b0cf853c7047fa08943c4a7a0329d4434555e2da18'
AND (
token = 'nfRFpSqfTSOFEGUKJ4pafFx3UFblRBwazK/cSJwfZXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)