UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kGVGRCok1/Dkszf6wpK5I9WGkn0171UbuOffG8tOxk='
WHERE
key_id = '66ffb771a4d7028950976427cf446818fd62effc1d43d86cec891e507e71ecef'
AND (
token = '0kGVGRCok1/Dkszf6wpK5I9WGkn0171UbuOffG8tOxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)