UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MVKkf0Agz6rVO8M7NM7K2YgTMBmwHMTXL/jPygwls8k=' 
WHERE 
  key_id = '3d07277f41ca6d04f38f23cd2891cdde120f7be1aa43e258b79a4ecb1505c31a' 
  AND (
    token = 'MVKkf0Agz6rVO8M7NM7K2YgTMBmwHMTXL/jPygwls8k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026