UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F8ivwQ423OxsaKR9b/CtRl0MsO2wTrfFex6r6CGH0KQ='
WHERE
key_id = 'c495ca5a5a137a536a82e9894117623b81c6ad26a52b091dbddd4725dd7505e5'
AND (
token = 'F8ivwQ423OxsaKR9b/CtRl0MsO2wTrfFex6r6CGH0KQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)