UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/q3htAe8fLjUY5c/KIIsxIRH9djQ8Z4o2E30HIZnYI=' 
WHERE 
  key_id = '2ac1e6bcabcfde514c79562a51a138f363c5d61f469642af6b16d4e1f64865f0' 
  AND (
    token = 'U/q3htAe8fLjUY5c/KIIsxIRH9djQ8Z4o2E30HIZnYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032