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

Query time 0.00050