UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kYlcazhlBzHFyfT3dH57mgSKzuQzs19YEfX7VzWck1A='
WHERE
key_id = '2b0de4e9b62c517a83b5d1e6abfbe83c6c86b52922bb8b8b6459f0a558db0d64'
AND (
token = 'kYlcazhlBzHFyfT3dH57mgSKzuQzs19YEfX7VzWck1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)