UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CFJVvIl/P014SU2+JzPIkHiuPiXLpKfyaEpNsw7pNFY='
WHERE
key_id = 'a8a0ac8c3fb729667588df9baef74eb35195c25fae9f31d1cf904373ecddbef4'
AND (
token = 'CFJVvIl/P014SU2+JzPIkHiuPiXLpKfyaEpNsw7pNFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)