UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4glqtX/Xfxzkj+dM652c/m37EFnq6Wzc8QlBYcxJhvY=' 
WHERE 
  key_id = 'fc3deec180ce703d18886e8c6abe6ceb368be98f1fb4886b823fe9cd0d39e509' 
  AND (
    token = '4glqtX/Xfxzkj+dM652c/m37EFnq6Wzc8QlBYcxJhvY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041