UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9gRHCAUzRbi2x2+mz6O7JjBeHPuIOYe4u1tmXB0bD7A='
WHERE
key_id = '0f3fa48c1164061a0addba58ad1313cfcb2d8a8031dd76b9c765e310519d4f3a'
AND (
token = '9gRHCAUzRbi2x2+mz6O7JjBeHPuIOYe4u1tmXB0bD7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)