UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1fA+JhNjxQr7PZodtEibJ1coxABdlozXyDW6EUN60HA='
WHERE
key_id = 'b0a7c4d68a40a3d2ca524062b5e898e90737e0827c40521c255ca5243d63d2ff'
AND (
token = '1fA+JhNjxQr7PZodtEibJ1coxABdlozXyDW6EUN60HA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)