UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MilmLUUMV+kJ/fLDPI2f0p0sghsM32koYoK4nkDTsks='
WHERE
key_id = 'f2a3f71dae8d5c3c96511a0d5c3ed12269e47c33cfb7165470cc52b4303826eb'
AND (
token = 'MilmLUUMV+kJ/fLDPI2f0p0sghsM32koYoK4nkDTsks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)