UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFoiaupjjgOwAcv+VHHPDm1jwY+TU28/Op13cPXEupU=' 
WHERE 
  key_id = '07048506291a14e7f26c440db0612b1d76337c639a6d8a40c96bf25ee36d7915' 
  AND (
    token = 'OFoiaupjjgOwAcv+VHHPDm1jwY+TU28/Op13cPXEupU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032