UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dmz5fhK68OdAL2z/RHALxxU5D8hwVQNpV20PFikggtE='
WHERE
key_id = '8d9f3d30b219dba61c945469018bc0354e3c897c758724af20673be62700c417'
AND (
token = 'dmz5fhK68OdAL2z/RHALxxU5D8hwVQNpV20PFikggtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)