UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CKIkOmvZT7SxV4bzPwrZLrRszQZq8t/N+wH5Dr9nm/Q='
WHERE
key_id = '00abea3c6ebd8115ae4e70a5959e8b4fb6d66b927f7dc59b87ed43e2804ec4ba'
AND (
token = 'CKIkOmvZT7SxV4bzPwrZLrRszQZq8t/N+wH5Dr9nm/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)