UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pgW/cG4zelRFpFP2EUoNDq1+TmjjmBqCnBqiD+RaXt4=' 
WHERE 
  key_id = 'ca0a36c0f3aba464c95ea3cd1132472d6a4edec8f32bf3b3f419fe4f8a196084' 
  AND (
    token = 'pgW/cG4zelRFpFP2EUoNDq1+TmjjmBqCnBqiD+RaXt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028