UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ff4W08BCDqFiJ84+rmRES3bIyGfXBEDXdFHDetkjl3g='
WHERE
key_id = '973e5b5ece7e5f37750a43eb559acd0672c1f0ae15a28a7a60f2cd9442647b7f'
AND (
token = 'Ff4W08BCDqFiJ84+rmRES3bIyGfXBEDXdFHDetkjl3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)