UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PBo9BJxGUVVy4S7KHJwaFX6v6efC3J7KPJadlfXh3TQ=' 
WHERE 
  key_id = 'aa7d435652cb90c5ba1e2473e26aa68fc9796d65c9b36b425e9f8b46fa944acf' 
  AND (
    token = 'PBo9BJxGUVVy4S7KHJwaFX6v6efC3J7KPJadlfXh3TQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040