UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R79QmDhqJPPdhl0Yp9tPjN19LW2Oxl9d6MtIUhWmjro=' 
WHERE 
  key_id = '86cbf845a7f890da48847064dd5c4721eaf863e988af865b986e57d42b03df42' 
  AND (
    token = 'R79QmDhqJPPdhl0Yp9tPjN19LW2Oxl9d6MtIUhWmjro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026