UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9I/wZtVHVfY9oCBxSLICvW74/ydTpeGWqzIAY40fM6k='
WHERE
key_id = '2b870b215e2da33da80de01270dae39865e5c7af682e0595275767190c99f127'
AND (
token = '9I/wZtVHVfY9oCBxSLICvW74/ydTpeGWqzIAY40fM6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)