UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xN8pGKt6fTzRDQAHixpYssRsy/ncaWg+x3VD71Iiz8Y=' 
WHERE 
  key_id = '621625506b2748587fb98bff3bc0310949fac7417a14a1c55c42329fa9260aa8' 
  AND (
    token = 'xN8pGKt6fTzRDQAHixpYssRsy/ncaWg+x3VD71Iiz8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035