UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5wZ0smvDnqNk8L7VHH8bzcESGMU2gTqJy/Vb3bVs3x4=' 
WHERE 
  key_id = '5c53981e8edf4074d9bc0f0589e0e3f957607a368a602facfb367c57d032bdd3' 
  AND (
    token = '5wZ0smvDnqNk8L7VHH8bzcESGMU2gTqJy/Vb3bVs3x4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037