UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a1l0gCmfc+UR9kLDNnZVrCP3T386qQZUugyHrWmaFdg='
WHERE
key_id = '198fac12e8733123034bef33a5f88da4f5d509f22d429ae2204b3f258881c336'
AND (
token = 'a1l0gCmfc+UR9kLDNnZVrCP3T386qQZUugyHrWmaFdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)